import React, { Component } from 'react';
import './index.less'
class Detail extends Component {
    state = {  }
    componentWillMount(){
        if(!this.props.location.state){
            this.props.history.push('/')
        }
    }
    render() { 
        let {url,price,lesson} = this.props.location.state || {}
        return (
            <div>
                <img src={url} />
                <p>{lesson}</p>
                <strong>{price}</strong>
            </div>
        );
    }
}
 
export default Detail;